/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.component.preference;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;

import com.cea.papyrus.core.preference.PreferenceConstants;

/**
 * Defines constants for component diagram preferences.
 * 
 * @author AL
 * @since 15 fev. 07
 */
public class ComponentDiagramPreferenceConstants {

	// Artifact
	/**
	 * The Constant P_ARTIFACT_BACKGROUNDCOLOR.
	 */
	public static final String P_ARTIFACT_BACKGROUNDCOLOR = "ComponentDiagramPreferenceConstants.Artifact.backGroundColor";
	
	/**
	 * The Constant P_ARTIFACT_BORDERCOLOR.
	 */
	public static final String P_ARTIFACT_BORDERCOLOR = "ComponentDiagramPreferenceConstants.Artifact.borderColor";
	
	/**
	 * The Constant P_ARTIFACT_FONTCOLOR.
	 */
	public static final String P_ARTIFACT_FONTCOLOR = "ComponentDiagramPreferenceConstants.Artifact.fontColor";
	
	/**
	 * The Constant P_ARTIFACT_FONT.
	 */
	public static final String P_ARTIFACT_FONT = "ComponentDiagramPreferenceConstants.Artifact.font";
	
	// Component
	/**
	 * The Constant P_COMPONENT_BACKGROUNDCOLOR.
	 */
	public static final String P_COMPONENT_BACKGROUNDCOLOR = "ComponentDiagramPreferenceConstants.Component.backGroundColor";
	
	/**
	 * The Constant P_COMPONENT_BORDERCOLOR.
	 */
	public static final String P_COMPONENT_BORDERCOLOR = "ComponentDiagramPreferenceConstants.Component.borderColor";
	
	/**
	 * The Constant P_COMPONENT_FONTCOLOR.
	 */
	public static final String P_COMPONENT_FONTCOLOR = "ComponentDiagramPreferenceConstants.Component.fontColor";
	
	/**
	 * The Constant P_COMPONENT_FONT.
	 */
	public static final String P_COMPONENT_FONT = "ComponentDiagramPreferenceConstants.Component.font";
	
	// Interface
	/**
	 * The Constant P_INTERFACE_BACKGROUNDCOLOR.
	 */
	public static final String P_INTERFACE_BACKGROUNDCOLOR = "ComponentDiagramPreferenceConstants.Interface.backGroundColor";
	
	/**
	 * The Constant P_INTERFACE_BORDERCOLOR.
	 */
	public static final String P_INTERFACE_BORDERCOLOR = "ComponentDiagramPreferenceConstants.Interface.borderColor";
	
	/**
	 * The Constant P_INTERFACE_FONTCOLOR.
	 */
	public static final String P_INTERFACE_FONTCOLOR = "ComponentDiagramPreferenceConstants.Interface.fontColor";
	
	/**
	 * The Constant P_INTERFACE_FONT.
	 */
	public static final String P_INTERFACE_FONT = "ComponentDiagramPreferenceConstants.Interface.font";


	// Port
	/**
	 * The Constant P_PORT_BACKGROUNDCOLOR.
	 */
	public static final String P_PORT_BACKGROUNDCOLOR = "ComponentDiagramPreferenceConstants.Port.backGroundColor";
	
	/**
	 * The Constant P_PORT_BORDERCOLOR.
	 */
	public static final String P_PORT_BORDERCOLOR = "ComponentDiagramPreferenceConstants.Port.borderColor";
	
	/**
	 * The Constant P_PORT_FONTCOLOR.
	 */
	public static final String P_PORT_FONTCOLOR = "ComponentDiagramPreferenceConstants.Port.fontColor";
	
	/**
	 * The Constant P_PORT_FONT.
	 */
	public static final String P_PORT_FONT = "ComponentDiagramPreferenceConstants.Port.font";
	
	// Package
	/**
	 * The Constant P_CLASS_BACKGROUNDCOLOR.
	 */
	public static final String P_PACKAGE_BACKGROUNDCOLOR = "ComponentDiagramPreferenceConstants.Package.backGroundColor";
	
	/**
	 * The Constant P_CLASS_BORDERCOLOR.
	 */
	public static final String P_PACKAGE_BORDERCOLOR = "ComponentDiagramPreferenceConstants.Package.borderColor";
	
	/**
	 * The Constant P_CLASS_FONTCOLOR.
	 */
	public static final String P_PACKAGE_FONTCOLOR = "ComponentDiagramPreferenceConstants.Package.fontColor";
	
	/**
	 * The Constant P_CLASS_FONT.
	 */
	public static final String P_PACKAGE_FONT = "ComponentDiagramPreferenceConstants.Package.font";
	
	// Class
	/**
	 * The Constant P_CLASS_BACKGROUNDCOLOR.
	 */
	public static final String P_CLASS_BACKGROUNDCOLOR = "ComponentDiagramPreferenceConstants.Class.backGroundColor";
	
	/**
	 * The Constant P_CLASS_BORDERCOLOR.
	 */
	public static final String P_CLASS_BORDERCOLOR = "ComponentDiagramPreferenceConstants.Class.borderColor";
	
	/**
	 * The Constant P_CLASS_FONTCOLOR.
	 */
	public static final String P_CLASS_FONTCOLOR = "ComponentDiagramPreferenceConstants.Class.fontColor";
	
	/**
	 * The Constant P_CLASS_FONT.
	 */
	public static final String P_CLASS_FONT = "ComponentDiagramPreferenceConstants.Class.font";
	
	// Getters
	
	/**
	 * Gets the preference artifact background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact background color
	 */
	public static RGB getPreferenceArtifactBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_ARTIFACT_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference artifact border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact border color
	 */
	public static RGB getPreferenceArtifactBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_ARTIFACT_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference artifact font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact font color
	 */
	public static RGB getPreferenceArtifactFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_ARTIFACT_FONTCOLOR);
	}

	/**
	 * Gets the preference artifact font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact font
	 */
	public static FontData[] getPreferenceArtifactFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_ARTIFACT_FONT);
	}
	// Component
	/**
	 * Gets the preference component background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference component background color
	 */
	public static RGB getPreferenceComponentBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_COMPONENT_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference component border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference component border color
	 */
	public static RGB getPreferenceComponentBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_COMPONENT_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference component font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference component font color
	 */
	public static RGB getPreferenceComponentFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_COMPONENT_FONTCOLOR);
	}

	/**
	 * Gets the preference component font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference component font
	 */
	public static FontData[] getPreferenceComponentFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_COMPONENT_FONT);
	}
	
	
	// Port	
	
	/**
	 * Gets the preference port background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference port background color
	 */
	public static RGB getPreferencePortBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PORT_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference port border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference port border color
	 */
	public static RGB getPreferencePortBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PORT_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference port font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference port font color
	 */
	public static RGB getPreferencePortFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PORT_FONTCOLOR);
	}

	/**
	 * Gets the preference port font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference port font
	 */
	public static FontData[] getPreferencePortFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_PORT_FONT);
	}
	// Interface
	/**
	 * Gets the preference device background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference interface background color
	 */
	public static RGB getPreferenceInterfaceBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_INTERFACE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference interface border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference interface border color
	 */
	public static RGB getPreferenceInterfaceBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_INTERFACE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference interface font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference interface font color
	 */
	public static RGB getPreferenceInterfaceFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_INTERFACE_FONTCOLOR);
	}

	/**
	 * Gets the preference interface font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference interface font
	 */
	public static FontData[] getPreferenceInterfaceFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_INTERFACE_FONT);
	}

	//	 Package
	/**
	 * Gets the preference class background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class background color
	 */
	public static RGB getPreferencePackageBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PACKAGE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference class border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class border color
	 */
	public static RGB getPreferencePackageBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PACKAGE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference class font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class font color
	 */
	public static RGB getPreferencePackageFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_PACKAGE_FONTCOLOR);
	}

	/**
	 * Gets the preference class font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class font
	 */
	public static FontData[] getPreferencePackageFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_PACKAGE_FONT);
	}
	
//	 Class
	/**
	 * Gets the preference class background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class background color
	 */
	public static RGB getPreferenceClassBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CLASS_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference class border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class border color
	 */
	public static RGB getPreferenceClassBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CLASS_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference class font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class font color
	 */
	public static RGB getPreferenceClassFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_CLASS_FONTCOLOR);
	}

	/**
	 * Gets the preference class font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference class font
	 */
	public static FontData[] getPreferenceClassFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_CLASS_FONT);
	}
	/**
	 * Sets the default preferences of the Artifact, Component, Port, Interface, Class  preference pages.
	 * 
	 * @param store the store
	 */
	public static void setDefaultPreferences(IPreferenceStore store) {
		// Artifact
		PreferenceConverter.setDefault(store, P_ARTIFACT_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_ARTIFACT_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_ARTIFACT_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_ARTIFACT_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// Component
		PreferenceConverter.setDefault(store, P_COMPONENT_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_COMPONENT_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_COMPONENT_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_COMPONENT_FONT, new FontData("Arial", 10, SWT.BOLD));		
		
		// Port
		PreferenceConverter.setDefault(store, P_PORT_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_PORT_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_PORT_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_PORT_FONT, new FontData("Arial", 10, SWT.BOLD));

		// Interface
		PreferenceConverter.setDefault(store, P_INTERFACE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_INTERFACE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_INTERFACE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_INTERFACE_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// Package
		PreferenceConverter.setDefault(store, P_PACKAGE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_PACKAGE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_PACKAGE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_PACKAGE_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// Class
		PreferenceConverter.setDefault(store, P_CLASS_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_CLASS_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_CLASS_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_CLASS_FONT, new FontData("Arial", 10, SWT.BOLD));
	}		
}